<?php
require_once("common.php");
$id = $_POST['id'];
$content = $_POST['content'];
if(!$id){ showmessage("非法ID");}
if(!$content){ showmessage("内容不能为空");}

$data['imageid'] = $id;
$data['content'] = $content;
$data['createtime'] = time();


inserttable("comment",$data);


if($db->affected_rows()>0){
	$url = "photo.php?page=".$_POST['page']."&pageSize=".$_POST['pageSize']."&id=".$id;
			header("content-type:text/html; charset=utf-8");

	echo "<script language='javascript'>
		 alert('评论成功！');
		 document.location.href= '$url';
	     </script>";
//	showmessage("评论成功！",);
}else{
	showmessage("评论失败！");
}

?>